package cn.com.utt.common.protorpc.message;

import com.google.protobuf.Message;

public class Callback {
	private boolean done = false;
	private int timeout = 30;
	private Message args;
	private Message reply;
	private String error;
	
	public Callback(Message args,Message reply){
		this.args = args;
		this.reply = reply;
	}
	
	public void run(Message message) {
		this.reply = message;
		synchronized(this) {
			done = true;
			notify();
		}
	}
	
	public boolean isDone() {
		return done;
	}

	public Message getArgs() {
		return args;
	}

	public void setArgs(Message args) {
		this.args = args;
	}

	public Message getReply() {
		return reply;
	}

	public void setReply(Message reply) {
		this.reply = reply;
	}

	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}

	public int getTimeout() {
		return timeout;
	}

	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}
	
	
	
}
